//
//  UIViewController+Base.h
//  FashionSpring
//
//  Created by 吕飞俊 on /6/3.
//  Copyright (c) 年 润媛. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MBProgressHUD.h"

@interface UIViewController (lvfjHelper)<MBProgressHUDDelegate>

-(void)showBossBuyProgress:(NSString *)text
                       img:(UIImage *)img
                     frame:(CGRect)frame
                    during:(float)during;

-(UIButton *)createServerPhoneBt;

-(void)callServerPhone;

-(void)replaceNavigationViewController:(UIViewController *)ctl;

- (void)requestShopingList:(void (^)())block;

-(void)handleError:(NSDictionary *)dic showAlertMsg:(NSString *)msg;

-(void)handleError:(NSDictionary *)dic
         showAlert:(BOOL)show;

-(void)presentLoginctl:(UIViewController *)fromctl;

//该方法是为了在登录后执行一些操作
-(void)presentLoginctl:(UIViewController *)fromctl andOperationBlock:(void(^)())block;

-(void)loginctlDosth:(UIViewController *)ctl
               block:(void(^)())block;

-(UIButton *)ctrateBarButton:(NSString *)title
                         img:(UIImage *)img
                      btSize:(CGSize)size;

-(UIButton *)ctrateBarButton:(NSString *)title
                         img:(UIImage *)img;

-(void)showAlertMsg:(NSString *)msg;

-(void)showFailedAlertMsg;

-(void)createRightBarButtonToCallServerPhone;

-(void)callPhone:(NSString *)phoneNo;

-(UIButton *)crateTopBt;

-(void)toTop:(UIScrollView *)scrollView;

-(void)scrollViewEndScroll:(UIScrollView *)scrollView
            setTopBtHidden:(UIButton *)bt;

/**
 *  弹出Toast消息
 *
 *  @param toast <#toast description#>
 */
- (void)showToast:(NSString *)toast;

/**
 *  弹出Toast消息
 *
 *  @param toast    <#toast description#>
 *  @param inWindos <#inWindos description#>
 */
- (void)showToast:(NSString *)toast inWindow:(BOOL)inWindos;

/**
 *  toast
 *
 *  @param toast 提示信息内容
 *  @param dur   显示的持续时间
 */
- (void)showToast:(NSString *)toast duration:(CGFloat)dur;

/**
 *  支持执行block的toast
 *
 *  @param toast      提示信息内容
 *  @param dur        显示的持续时间
 *  @param completion 需要执行的block
 */
- (void)showToast:(NSString *)toast
         duration:(CGFloat)dur
  completionBlack:(void (^)(void))completion;

- (void)showProcessHUD:(NSString *)text;

-(void)showProcessCommon;

-(void)hideProcessHUD;

@end
